//
//  SelfSizeTool.m
//  练习selfsize
//
//  Created by 苗钧豪 on 16/7/27.
//  Copyright © 2016年 苗钧豪. All rights reserved.
//

#import "SelfSizeTool.h"

@implementation SelfSizeTool
+ (CGFloat)selfSizeHeightWithString:(NSString *)string height:(CGFloat)height font:(UIFont *)font {
    CGRect newRect = [string boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, height) options:(NSStringDrawingUsesLineFragmentOrigin) attributes:@{NSFontAttributeName:font} context:nil];
    return newRect.size.width;
}
@end
